Skip to content

Conversation

kl0tl
Copy link
Member

@kl0tl kl0tl commented Nov 19, 2020

Responses to #40 seem more favorable to deprecating then removing Data.NonEmpty.foldl1.

@@ -47,8 +49,8 @@ singleton :: forall f a. Plus f => a -> NonEmpty f a
singleton a = a :| empty

-- | Fold a non-empty structure, collecting results using a binary operation.
foldl1 :: forall f a. Foldable f => (a -> a -> a) -> NonEmpty f a -> a
foldl1 f (a :| fa) = foldl f a fa
foldl1 :: forall f a. Foldable f => Warn (Text "'foldl1' is deprecated") => (a -> a -> a) -> NonEmpty f a -> a
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we give a suggestion there?

'Data.NonEmpty.foldl1' is deprecated, use  'Data.Semigroup.Foldable.foldl1' instead

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's a good idea -- better to suggest the proper alternative as there is one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants